package com.giambo.caatdef;


import com.appl.cacciaaltesoro.CacciaAlTesoro;


import android.content.Context;
import android.location.Criteria;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;

public class CacciaTesoroDef extends CacciaAlTesoro {
	
	private static final String LOC_TAG = "";
	private Context ctx;
	private LocationManager mylocman;
	private String MockLocationProvider = "Test_Provider";
	
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       
        ctx = this.getApplicationContext();
        
        mylocman = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
        
        if(mylocman.getProvider(MockLocationProvider)!=null){
        	mylocman.removeTestProvider(MockLocationProvider);
        }
        
        mylocman.addTestProvider(MockLocationProvider, false, false, false, false, true, true, true,Criteria.POWER_LOW, Criteria.ACCURACY_COARSE);
        
        if(mylocman.getProvider(MockLocationProvider)!= null){
        	Log.d(LOC_TAG, "E'stato aggiunto sto benedetto Test Provider");
        }
        mylocman.setTestProviderEnabled(MockLocationProvider, true);
        
        mylocman.requestLocationUpdates(MockLocationProvider, 0, 0,this);
        Log.d(LOC_TAG, "Prima di prelevare i dati");
        Log.d(LOC_TAG, "Parte il Provider");
    	
        new MockProvider(mylocman, MockLocationProvider, ctx).start();
        
                
    }
    
}